package com.berwin.bmfb.views.components;

import javax.swing.*;
import java.awt.*;

public class SpinnerItemView extends JPanel {

    private String title;

    private JSpinner spinner;

    public SpinnerItemView(String title, int value) {
        this.title = title;
        this.setLayout(new GridLayout(1, 2));

//        JPanel leftContainers = new JPanel(new FlowLayout(FlowLayout.RIGHT));
//        this.add(leftContainers);
//        JPanel left = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.CENTER));
//        leftContainers.add(left);
        JLabel lblTitle = new JLabel(this.title);
        this.add(lblTitle);

//        JPanel right = new JPanel(new FlowLayout(FlowLayout.LEADING));
//        this.add(right);
        SpinnerModel model = new SpinnerNumberModel(value, 0, 1000, 1);
        this.spinner = new JSpinner(model);
        this.add(this.spinner);

        this.setBackground(Color.GRAY);

    }

}
